import plotly.offline as pyo
from plotly.graph_objs import *
import chart_studio.plotly as py
import pandas as pd
from pandas import DataFrame
from plotly import tools
import random
pyo.offline.init_notebook_mode()
plots = tools.make_subplots(cols = 2, rows = 2, print_grid = True)
This is the format of your plot grid: [ (1,1) x,y ] [ (1,2) x2,y2 ] [ (2,1) x3,y3 ] [ (2,2) x4,y4 ]
plots.append_trace(trace = {'type' : 'scatter',
'mode' : 'markers',
'x' : [random.random() for i in range(10)],
'y' : [random.random() for i in range(10)],
'name' : 'trace1'},
row=1, col=1)
pyo.iplot(plots)
plots.append_trace(trace = {'type' : 'scatter',
'mode' : 'markers',
'x' : [random.random() for i in range(10)],
'y' : [random.random() for i in range(10)],
'name' : 'trace2'},
row=1, col=2)
pyo.iplot(plots)
plots.append_trace(trace = {'type' : 'scatter',
'mode' : 'markers',
'x' : [random.random() for i in range(10)],
'y' : [random.random() for i in range(10)],
'name' : 'trace3'},
row=2, col=1)
plots.append_trace(trace = {'type' : 'scatter',
'mode' : 'markers',
'x' : [random.random() for i in range(10)],
'y' : [random.random() for i in range(10)],
'name' : 'trace4'},
row=2, col=2)
pyo.iplot(plots)
plots.append_trace(trace = {'type' : 'scatter',
'mode' : 'markers',
'x' : [random.random() for i in range(10)],
'y' : [random.random() for i in range(10)],
'name' : 'trace5'},
row=1, col=1)
pyo.iplot(plots)